package com.renjiyue.Day1;

import java.util.Arrays;

public class Test01 {


    public static void main(String[] args) {
        // 0 -8 正好对应数组的索引
        int[] arr = {1,2,3,4,5,6,7,8,9};

        System.out.println("面向过程 --------");
        System.out.print("[");
        //面向过程
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
            if(i != arr.length - 1){
                System.out.print(", ");
            }
        }
        System.out.print("]");

        System.out.println();

        System.out.println("面向对象 ---------");
        System.out.println(Arrays.toString(arr));
    }
}
